﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ComeSeeThis_MVC2.Models
{
    public class VehicleTypeTireFormView
    {
        public List<VehicleType> VehicleTypes { get; private set; }
        public Tire Tire { get; private set; }

        public VehicleTypeTireFormView(int tireId)
        {
            //var boo = new TireRepository().VehicleTypeTire(tireId);
            //VehicleTypes = new List<VehicleType>();
            //foreach (var tire in boo)
            //{
            //    var veht = new VehicleTypeRepository().GetVehicleType(tire.Key.VehicleTypeId);
            //    VehicleTypes.Add(veht);
            //}
            Tire = new TireRepository().GetTire(tireId);
            VehicleTypes = Tire.VehicleTypes.OrderBy(x => x.VehicleTypeName).ToList();

        }
    }
}